package com.d3works.apps.account.service.moveline;

import com.d3works.apps.account.db.Move;
import com.d3works.apps.account.db.MoveLine;
import com.d3works.apps.base.db.Batch;
import com.d3works.apps.base.db.Partner;
import com.d3works.exception.D3worksException;
import com.d3works.meta.CallMethod;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

public interface MoveLineService {

  public MoveLine balanceCreditDebit(MoveLine moveLine, Move move);

  public void usherProcess(MoveLine moveLine);

  public void reconcileMoveLinesWithCacheManagement(List<MoveLine> moveLineList);

  public void reconcileMoveLines(List<MoveLine> moveLineList);

  public MoveLine setIsSelectedBankReconciliation(MoveLine moveLine);

  public MoveLine removePostedNbr(MoveLine moveLine, String postedNbr);

  boolean checkManageCutOffDates(MoveLine moveLine);

  void applyCutOffDates(
      MoveLine moveLine, Move move, LocalDate cutOffStartDate, LocalDate cutOffEndDate);

  BigDecimal getCutOffProrataAmount(MoveLine moveLine, LocalDate moveDate);

  public boolean checkManageAnalytic(Move move) throws D3worksException;

  @CallMethod
  LocalDate getFinancialDiscountDeadlineDate(MoveLine moveLine);

  void computeFinancialDiscount(MoveLine moveLine);

  void computeInvoiceTermsFinancialDiscount(MoveLine moveLine);

  Batch validateCutOffBatch(List<Long> recordIdList, Long batchId);

  void updatePartner(List<MoveLine> moveLineList, Partner partner, Partner previousPartner);
}
